import request from '@/utils/request'


export function getTermsListByTeacherAPI() {
  return request({
    url: '/terms/listByTeacher',
  })
}

export function getTermsListByStudentAPI() {
  return request({
    url: '/terms/listByStudent',
  })
}

export function getAllTermsAPI() {
  return request({
    url: '/terms/getAllTerms',
  })
}

export function getAllTermsByPageAPI(params) {
  return request({
    url: '/terms/getAllTermsByPage',
    params
  })
}
export function exportExcelAPI(params) {
  return request({
    url: '/terms/exportExcel',
    method: 'GET',
    responseType: 'blob', 
    params
  });
}

export function addOrEditTermAPI(terms) {
  return request({
    url: '/terms/addOrEditTerm',
    method: 'post',
    data: terms
  })
}

export function deleteTermAPI(id){
  return request({
    url:`/terms/deleteTerm/${id}`,
    method: 'delete'
  })
}
